package com.jht.bletool2kotlin.activity.homepage.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter

class HomeViewPageAdapter(fm: FragmentManager, private val data:List<Fragment>,private val head:List<String>) : FragmentPagerAdapter(fm,BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {

    override fun getCount(): Int {
       return data.size
    }

    override fun getItem(position: Int): Fragment {
         return data[position]
    }

    override fun getPageTitle(position: Int): CharSequence {
        return  head[position]
    }

}